<!DOCTYPE html>
<html lang="en" class="no-js" xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
	layout:decorator="layout">
<head>
<title>哗啦啦</title>
</head>
<body>
	<div layout:fragment="content">
		<div class="col-md-12">
			<div class="area game">
				<div class="top1">
					<div class="col-md-3"></div>
					<div class="col-md-6">
						<div th:with="game=${game}" th:replace="game/gamehead"></div>
					</div>
					<div class="col-md-3"></div>
				</div>
				<div class="blank"></div>
				<div
					style="border: 1px solid #ccc; border-radius: 4px; padding: 5px;">
					<div class="top2" th:include="game/gamesubhead"></div>
					<div class="blank"></div>
					<div>选择查看方式：
					    <span >
					    <input id="1_0" type="radio" name="type" th:checked="${type=='1'?'checked':'false'}" value="1" />
					    <label for="1_0">投注总和</label>
					    <input id="1_1" type="radio" name="type" th:checked="${type=='2'?'checked':'false'}" value="2"/>
					    <label for="1_1">手动投注</label>
					    <input id="1_2" type="radio" name="type" th:checked="${type=='3'?'checked':'false'}" value="3" />
					    <label for="1_2">挂机总和</label>
					    <input id="1_3" type="radio" name="type" th:checked="${type=='4'?'checked':'false'}" value="4" />
					    <label for="1_3">单个方案</label></span>
					    <select name="DropDownList1" id="DropDownList1">
					    	<option th:each="autobet:${autobets}" th:selected="${('AUTO_BET,'+autobet.id)==auto?'selected':'false'}" th:value="${'AUTO_BET,'+autobet.id}" th:text="${autobet.name}"></option>
					    	<option th:each="permutationbet:${permutationbets}" th:selected="${('PERMUTATION_BET,'+permutationbet.id)==auto?'selected':'false'}" th:value="${'PERMUTATION_BET,'+permutationbet.id}" th:text="${permutationbet.name}"></option>
						</select>
					    <input type="button" onclick="checkOnsubmit()" name="Button1" value="确定" id="Button1" />
					</div>
					<div style="height: 7px;"></div>
					<div>
					    <input type="button" onclick="dateClick('up')" name="Button2" value="上一天记录" id="1_Button2" />
					    <span id="Label1" style="color:#6600CC;font-weight:bold;" th:text="${date}">2014年12月27日</span>的记录
					    <input type="button" onclick="dateClick('down')" name="Button3" value="下一天记录" id="Button3" />
					    &nbsp;&nbsp;
					    统计信息：参与<span id="Label2" style="color:#0066CC;font-weight:bold;" th:text="${total}">1</span>期，
					    赢利：<span id="Label3" class="money" th:text="${profit}">-1</span>，
					    胜率：<span id="Label5" style="color:Red;font-weight:bold;" th:text="${win_rate+'%'}">0.00%</span>
					</div>
					<form id="search_form" th:action="@{'/fgame/'+${game.id}+'/selfbet'}" method="post" style="display: none;">
						<input id="type" name="type"/>
						<input id="auto" name="auto"/>
						<input id="date" name="date"/>
						<input id="upOrdown" name="upOrdown"/>
					</form>
					<div>
					<table class="gtable" border="1" cellspacing="1" cellpadding="0" style="border-style:None;">
						<tr>
							<th style="width:80px;">期数 </th>
							<th style="width:130px;">截止时间 </th>
							<th style="width:225px;">游戏结果 </th>
							<th style="width:196px;">(我的)中奖/金币 </th>
							<th>赢利</th>
							<th>详细 </th>
						</tr>
						<tr th:each="period:${periods}">
							<td th:text="${period.period}">10106711</td>
							<td th:text="${#dates.format(period.lotteryTime,'MM-dd HH:mm:ss')}">12-27 11:40:39</td>
							<th:block th:if="${game.id == 4}">
										<td>
											<div class='pk10numtd'>
												<div th:each="data:${period.resultFromNumbers_arr}" th:style="${dataStat.index == 0?'border:2px solid #0D9B17;':''}" th:class="${'pk10n'+data}"></div>
											</div>
										</td>
									</th:block>
									
									<th:block th:unless="${game.id ==4}">
										<td>
											<div class='com1td xy28'>
												<th:block th:each="data:${period.resultFromNumbers_arr}">
													<th:block th:if="${dataStat.index != (game.repeatTimes-1)}">
														<div th:class="${game.id==1?'xy28div1':'saizi'}" th:classappend="${(game.id==1?'gamean':'gamecn')+data}"></div>
														<div class="icon">+</div>
													</th:block>
													<th:block th:if="${dataStat.index == (game.repeatTimes-1)}">
														<div th:class="${game.id==1?'xy28div1':'saizi'}" th:classappend="${(game.id==1?'gamean':'gamecn')+data}"></div>
														<div class="icon">=</div>
													</th:block>
												</th:block>
												<div class="xy28div2"
													th:classappend="${'gamebn'+period.resultNumber}"></div>
												<div class="clearBoth"></div>
											</div>
										</td>
									</th:block>
				            <td th:text="${period.singleUserBetMoney+'|'+period.singleUserWinMoney}"></td>
				            <td th:text="${period.profit}">-1</td>
				            <td class="actionbt">
				                <a th:href="@{'/fgame/'+${game.id}+'/lotteryResult?period='+${period.period}}">查看</a>
				            </td>
						</tr>
					</table>
					<div th:include="page" th:with="viewState=${viewState},url=${'/fgame/'+game.id+'/selfbet'},pageContext=${periods}"></div>
				</div>
				</div>
			</div>
		</div>
		<script>
			function checkOnsubmit(){
				$('#type').val($('input:checked').val());
				$('#auto').val($('#DropDownList1').val());
				$('#date').val($('#Label1').html());
				$('#search_form').submit();
			}
			
			function dateClick(str){
				$('#upOrdown').val(str);
				checkOnsubmit();
			}
		</script>
	</div>
</body>
</html>